<template>
	<view>
		<view class="main">
			<!-- 用户信息 start -->
			<view class="userinfo">
				<image src="../../static/images/Avatar.png" mode="" class="avatar"></image>
				<view class="username">
					<view style="font-size: 40upx;font-weight: bold;">{{name}}</view>
					<view style="color: #C0C0C0;margin-top: 20upx;">{{roleType==1?'学生':roleType==2?'科任老师':'家长'}}</view>
				</view>
				<image src="../../static/icon/ListMore.png" mode="" class="img_more" style="top: 80upx;"></image>
			</view>
			<!-- 用户信息 end -->
			
			<!-- 设置 -->
			<view class="setting">
				<image src="../../static/icon/SetUp.png" mode="" class="img_icon"></image>
				<text>設置</text>
				<image src="../../static/icon/ListMore.png" mode="" class="img_more"></image>
			</view>
			
			<!-- 版本 -->
			<view class="version">
				<text>當前版本</text>
				<text style="position: absolute;right: 20upx;">1.1.1</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				name:"",
				roleType: 0
			}
		},
		onLoad() {
			this.roleType = uni.getStorageSync("roleType")
		},
		onShow() {
			this.getName()
		},
		methods: {
			getName(){
				this.name = uni.getStorageSync('name')
			}
		}
	}
</script>

<style lang="scss" scoped>
	image {
		width: 60upx;
		height: 60upx;
		vertical-align: middle;
	}
	/* 用户信息 */
	.userinfo{
		display: flex;
		justify-content: flex-start;
		padding: 40upx;
		background-image: url(../../static/images/UserBg.png);
		background-repeat: no-repeat;
		background-size: 100%;
	}
	/* 用户头像 */
	.avatar{
		width: 150upx;
		height: 150upx;
		vertical-align: middle;
		margin-right: 30upx;
	}
	/* 设置/版本 */
	.setting,
	.version{
		line-height: 80rpx;
		position: relative;
		padding: 20upx;
		background-color: #FFFFFF;
		margin: 20upx auto;
		border-radius: 20upx;
		box-shadow: 0 5px 20px #e4e5e6;
	}
	.setting{
		margin-top: 0;
	}
	.img_icon{
		margin-right: 30upx;
	}
	.img_more{
		position: absolute;
		right: 0;
		margin: 10upx;
	}
	
</style>
